import http from '../plugins/http';

interface IDataModal {
    id: string;
    title: string;
    author: string;
    content: string;
    cover: string;
    type: number;
    status: number;
    createTime: string;
    recentReadingTime: number;
}
interface IResultModal {
    code: number;
    data: IDataModal[];
    msg: string;
}

interface IResultModal2 {
    code: number;
    data: IDataModal[];
    msg: string;
}


export const getBlogArticle = async (type: string | number) => {
    const result: IResultModal = await http.post('/api/article/getArticleList', {
        status: 2,
        type,
    });
    return result;
}

export const getBlogArticleDetail = async (id: string) => {
    const result: IResultModal2 = await http.post('/api/article/getArticle', {
        id,
    });
    return result;
}